package common

import (
	"encoding/hex"
	"log"
	"my-crawler/concurrence/task/mohurd/aes"
)

func DecodeDecryptString(b []byte) string {
	key := []byte("jo8j9wGw%6HbxfFn")
	iv := []byte("0123456789ABCDEF")
	toString, err := hex.DecodeString(string(b))
	if err != nil {
		log.Fatal(err)
	}
	plaintext, err := aes.AesDecrypt(toString, key, iv)
	if err != nil {
		panic(err)
	}
	return string(plaintext)
}
